/**
 * 
 */
package com.lorizz.picpub.web.controller;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author wind hong
 * 
 */
@Controller
public interface UploadController {

    @RequestMapping(value = "/upload", method = RequestMethod.GET)
    String upload(Model model, @RequestParam(value = "albumId", required = false, defaultValue = "0") long albumId);

    @ResponseBody
    @Transactional
    @RequestMapping(value = "/upload", method = RequestMethod.POST)
    String uploadSingle(@RequestParam("image") MultipartFile image, @RequestParam("albumId") long albumId,
            HttpSession session, Model model);

}
